from selenium.webdriver.common.by import By



byid = By.ID
byname = By.NAME
bycname = By.CLASS_NAME
bytname = By.TAG_NAME
bylink = By.LINK_TEXT
bycss = By.CSS_SELECTOR
byxpath = By.XPATH
byparriallike = By.PARTIAL_LINK_TEXT


# 权限管理
class permission_manage:
    """添加权限的定位"""
    """记得要考虑frame框架"""
    # 权限管理 --- 菜单
    permission_manage = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[2]/ul/li[2]/div/a'
    # 添加权限
    permission_add = bycname, 'add'
    # 权限名称
    permission_name = bycname, 'required.textInput'
    # 权限标识
    permission_sign  = byxpath, '//*[@id="form1"]/div[1]/p[2]/input'
    # 权限描述
    permission_desk = byname, 'remark'
    # 保存
    permission_save = byxpath, '//*[@id="form1"]/div[2]/ul/li[1]/div/div/button'
    # 点击确定
    permission_commit = byxpath, '//*[@id="alertMsgBox"]/div[1]/div/div[2]/ul/li/a/span'

permission_pe = permission_manage()

# 角色管理
class role_manage:
    """添加角色的定位"""
    # 角色管理 --- 菜单
    role_manage = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[2]/ul/li[3]/div/a'
    # 添加角色 --- 执行业务的时候，需要换成第一个
    # role_add = byxpath, '//*[@id="navTab"]/div[2]/div[3]/div[2]/div[1]/ul/li/a'
    role_add = byxpath,   '//*[@id="navTab"]/div[2]/div[2]/div[2]/div[1]/ul/li/a'
    # 角色名称
    role_name = byxpath, '//*[@id="form"]/div[1]/p[1]/input'
    # 角色编码
    role_code  = byxpath, '//*[@id="form"]/div[1]/p[2]/input'
    # 角色描述
    role_desk = byname, 'remark'
    # 保存
    role_save = byxpath, '//*[@id="form"]/div[2]/ul/li[1]/div/div/button'


role_pe = role_manage()

# 操作员管理
class operator_manage:
    """操作员管理的定位"""
    # 操作员管理 --- 菜单
    operator_manage = byxpath, '/html/body/div[1]/div[2]/div[2]/div[2]/div[2]/ul/li[4]/div/a'
    # 添加操作员
    operator_add = bycname, 'add'
    # 操作员姓名
    operator_name = byxpath, '//*[@id="form"]/div[1]/p[2]/input'
    # 操作员登录名
    operator_login_name = byxpath, '//*[@id="form"]/div[1]/p[3]/input'
    # 密码
    operator_pwd = byname, 'loginPwd'
    # 手机号码
    operator_phone = byname, 'mobileNo'
    # 状态
    operator_select = bycname, 'required'
    # 状态 - 激活
    operator_activation  = byxpath, '/html/body/ul[2]/li[2]/a'
    # 滚动窗口 -----  到底部

    # 描述
    operator_desk = byname, 'remark'
    # 选择角色
    operator_role = byxpath, '/html/body/div[14]/div[2]/div/form/div[1]/fieldset/label[1]/input'

    # 退出frame框架
    # 保存
    operator_save = byxpath, '/html/body/div[14]/div[2]/div/form/div[2]/ul/li[1]/div/div/button'

operator_pe = operator_manage()











